package com.job.sun.HomeWork0717;

import java.util.Calendar;
import java.util.Scanner;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-18 11:52:58
 */
public class Work {
    public static void main(String[] args) {
        CharCount[] cc = new CharCount[24];
        CharCount cs = new CharCount();
        for (int i = 0; i < 24; i++) {
            cc[i] = new CharCount();
        }
        int count = 0;
        int num = 0;
        int q = 0;

        Scanner sc = new Scanner(System.in);
        String next = sc.next();
        for (int j = 0; j < next.length(); j++) {
            char c = next.charAt(j);
            if (Character.isUpperCase(c)) {
                num++;
                q = 0;
                if (num == 1) {
                    cc[count].code = c;
                    cc[count].count++;
                    continue;
                }

                for (int o = 0; o < count; o++) {

                    if (next.charAt(j) == cc[o].code) ;
                    {
                        cc[o].count++;
                        q++;
                    }
                }


                if (q == 0) {
                    count++;
                    cc[count].code = c;
                }

            }
        }
        for (int m = 0; m < count - 1; m++) {
            for (int k = 0; k < count - m - 1; k++) {
                if (cc[k].count > cc[k + 1].count) {
                    cs.code = cc[k].code;
                    cc[k + 1].code = cc[k].code;
                    cc[k].code = cs.code;
                }
            }


        }

        for (int l = 0; l <= count; l++) {
            System.out.println(cc[l].code + ",");

        }

    }

}
